<?php
$model_product_category = new Model_ProductCat_ProductCat();
$model_product = new Model_Product_Product();
$model_product_image = new Model_ProductImage_ProductImage();
$dataCat = $model_product_category->getAllIsActive();
$item_pro = $this->data;
$item_pro_img = $model_product_image->getItemsByProduct($item_pro['id']);
$items_related = $model_product->getRelatedProduct($item_pro['id']);
$product_ini = new Zend_Config_Ini(APPLICATION_PATH."/configs/website.ini","product");
?>
<link rel="stylesheet" href="<?php echo $this->baseUrl();?>/public/templates/default/colorbox/colorbox.css" />
<script src='<?php echo $this->baseUrl();?>/public/templates/default/js/jquery.elevatezoom.js'></script>
<script src='<?php echo $this->baseUrl();?>/public/templates/default/colorbox/jquery.colorbox.js'></script>
<script>
$(document).ready(function(){
	//initiate the plugin and pass the id of the div containing gallery images
	$("#zoom_img").elevateZoom({gallery:'gallery_orther', cursor: 'pointer', galleryActiveClass: 'active', imageCrossfade: true, loadingIcon: 'http://www.elevateweb.co.uk/spinner.gif'}); 

	//pass the images to Fancybox
	$("#zoom_img").bind("click", function(e) {  
	  var ez =   $('#zoom_img').data('elevateZoom');	
		$.fancybox(ez.getGalleryList());
	  return false;
	});
	$("#btn_order_intro").click(function(){
		$("#order_intro").toggle('slow');
		return false;
	});
	$("#btn_order_form").colorbox();
});
</script>
<div class="main product_page">
<div class="container detail_product">
<div class="menu_left">
<h3>Sản phẩm</h3>
<ul>
<?php
foreach ($dataCat as $item_cat)
{
	echo '<li><a href="'.$this->baseUrl().$model_product_category->getLinkById($item_cat['id']).'">'.$item_cat['name'].'</a></li>';
}
?>
</ul>
</div>
<!-- end menu_left-->
<div class="product">

<img class="feature_img_detail_product" id="zoom_img" src="<?php echo $this->baseUrl()?>/public/images/products/thumbs/<?php echo $item_pro['image']; ?>" data-zoom-image="<?php echo $this->baseUrl()?>/public/images/products/<?php echo $item_pro['image']; ?>" />
<div class="info_detail_pro">
<h4><?php echo $item_pro['name'];?></h4>
<p class="code_detail">Tình trạng: <?php if($item_pro['status']=='1') echo '<span class="in_stock">Còn hàng</span>'; else echo '<span class="out_stock">Hết hàng</a>';?></p>
<p class="gia_detail">Giá: <?php echo number_format($item_pro['price']);?>
VNĐ</p>
<?php 
	if(isset($this->success))
	{
		echo '<div class="notice success">'.$this->success.'</div>';
	}
	if(isset($this->error))
	{
		echo '<div class="notice error">'.$this->error[0].'</div>';
	}
?>
<a href="#" class="bt_detail" id="btn_order_intro">Cách thức mua hàng</a> 
<a href="<?php echo $this->baseUrl();?>/public/images/products/size/<?php echo $product_ini->size?>" class="bt_detail" id="btn_order_form">Bảng số đo</a>
<div class="clear"></div>
<div id="order_intro" class="content_hidden">
<h3>Cách thức mua hàng online qua Website Sonita</h3>
<p>
- Bước 1: Quý khách vào shop online xem chi tiết và chọn mã sản phẩm, sau đó gọi điện tới Hotline 091 337 8938 để đặt hàng. Nhân viên trực hotline sẽ tư vấn cho quý khách về chất liệu sản phẩm, size, màu sắc, kiểm tra còn hàng hay không.
</p><p>
- Bước 2: Nhân viên trực hotline sẽ tiếp nhận thông tin về tên khách hàng, số điện thoại, địa chỉ giao hàng.
 </p><p>
- Bước 3: Hotline sẽ nhắn cho quý khách số tài khoản chuyển tiền.
 </p><p>
- Bước 4: Khi tiền về tài khoản, hotline sẽ chuyển hàng cho quý khách theo địa chỉ cung cấp
</p>
</div>
<div id="order_form" class="content_hidden">
<?php 
	if($product_ini->size!="")
		echo '<img src="'.$this->baseUrl().'/public/images/products/size/'.$product_ini->size.'" alt="" />';
?>
</form>
</div>
<p class="sp_cungbo">Chi tiết sản phẩm:</p>
<p><?php echo $item_pro['summary'];?></p>

<p class="sp_cungbo">Chia sẻ:</p>
<span class='st_facebook_hcount' displayText='Facebook'></span> <span
	class='st_googleplus_hcount' displayText='Google +'></span> <span
	class='st_twitter_hcount' displayText='Tweet'></span> <span
	class='st_sharethis_hcount' displayText='ShareThis'></span>
<div class="clear"></div>
<div class="img_orther" id="gallery_orther">
<a href="#" data-image="<?php echo $this->baseUrl()?>/public/images/products/thumbs/<?php echo $item_pro['image']; ?>" data-zoom-image="<?php echo $this->baseUrl()?>/public/images/products/<?php echo $item_pro['image']; ?>">
	<img src="<?php echo $this->baseUrl()?>/public/images/products/thumbs/<?php echo $item_pro['image']; ?>" data-zoom-image="<?php echo $this->baseUrl()?>/public/images/products/<?php echo $item_pro['image']; ?>" />
</a>
<?php 
foreach ($item_pro_img as $item_img)
{
	echo '<a href="#" data-image="'.$this->baseUrl().'/public/images/products/thumbs/'.$item_img['filename'].'" data-zoom-image="'.$this->baseUrl().'/public/images/products/'.$item_img['filename'].'">';
	echo '<img src="'.$this->baseUrl().'/public/images/products/thumbs/'.$item_img['filename'].'" alt="" />';
	echo '</a>';
}
?>
</div>
</div>
<!-- end info_detail_pro-->
<div class="clear"></div>
<h4 class="lienquan">Các sản phẩm liên quan</h4>
<ul>
<?php
foreach ($items_related as $item_related)
{
	?>
	<li><a
		href="<?php echo $this->baseUrl().$model_product->getLinkById($item_related['id'])?>"><img
		src="<?php echo $this->baseUrl()?>/public/images/products/<?php echo $item_related['image'];?>"
		alt="" /></a>
	<p class="code">Mã số: <?php echo $item_related['code']?></p>
	<p class="price">Giá: <?php echo number_format($item_related['price']);?>
	VND</p>
	</li>
	<?php
}
?>
</ul>
</div>
<!-- end product--></div>
<div class="clear"></div>
<?php $this->LoadBlock('BottomMenu');?></div>
<!-- end main-->